<template>
  <div class="cart-list">
    <scroll class='content' ref='scroll'>
      <cart-list-item v-for='(item, index) in cartList' :item-info='item' :key='index' />
    </scroll>
  </div>

</template>

<script>
import Scroll from 'components/common/scroll/Scroll'

import CartListItem from './CartListItem.vue'


// 导入映射 辅助函数
import { mapGetters} from 'vuex'

export default {
  name: 'CartList',
  components:{
    Scroll,
    CartListItem
  },
  data(){
    return {
    }
  },
  created(){},
  mounted(){},
  watch:{},
  computed:{
    ...mapGetters({
      cartList: 'cartList'
    })
  },
  activated() {
    // 重新进入 购物车页面 属刷新可滚动高度
    this.$refs.scroll.refresh()
  },
  methods:{},
}
</script>
<style scoped>
.cart-list {
  height: calc(100% - 44px - 49px - 44px);
}
.content {
  height: calc(100%);
  overflow: hidden;
}
</style>